﻿package com.evidencer.java.net;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class TCPServerTest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		ServerSocket ss=new ServerSocket(10000);
		Socket s=ss.accept();
		
		BufferedReader br=new BufferedReader(new InputStreamReader(s.getInputStream()));
		String line="";
		while((line=br.readLine())!=null&&!"".equals(line)){
			System.out.println(line);
		}
		
		
		BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
		
		bw.write("<font color='red' size='8'>Hello World!</font>");
		bw.flush();
		
		
		s.close();
		ss.close();

	}

}
